<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        position: relative;
        height: 300px;
        background-color: red;
        margin: 0 auto;
        width: 80%;
        padding: 100px;
        box-sizing: border-box;
      }
      .item {
        /* 定位元素：查看内容+padding区域 */
        /* position: absolute; */
        /* 未定位的元素：百分比相对的是父元素内容区 */
        width: 50%;
        height: 200px;
        background-color: lightblue;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="item"></div>
    </div>
  </body>
</html>
